import 'package:flutter_test/flutter_test.dart';
import 'package:im_app/im/socket/dto/business/Message.dart';
import 'package:logger/logger.dart';

void main() {
  var _logger = Logger(printer: PrettyPrinter(),);

  test("test extends", () async {
    var messageObjects = <MessageObject>[];
    var messageObject = MessageObject('fromUserId', 'content', MessageType.Image);
    var messageObject2 = MessageObject('fromUserId2', 'content2', MessageType.RichText);
    var refMessageObject = RefMessageObject(messageObject2);
    messageObjects.add(messageObject);
    messageObjects.add(refMessageObject);

    for (var m in messageObjects) {
      if (m is! RefMessageObject) {
        _logger.i('m: ${m.fromUserId}');
      } else {
        _logger.i('rm: ${m.fromUserId}');
      }
    }
  });
}